package ch.fusun.baron.unit.service;

import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.data.DataUpdate;
import ch.fusun.baron.map.Tile;
import ch.fusun.baron.unit.Unit;

/**
 * 
 */
public class AddUnitToLocation implements DataUpdate {

	private Tile location;
	private Unit unit;
	@Inject
	private transient UnitService unitService;

	/**
	 * Kryo
	 */
	public AddUnitToLocation() {
	}

	/**
	 * @param location
	 * @param unit
	 */
	public AddUnitToLocation(Tile location, Unit unit) {
		this.location = location;
		this.unit = unit;
	}

	@Override
	public void update() {
		unitService.addUnitToLocation(location, unit);
	}
}
